http://www.codestore.net/store.nsf/area/A1001D27C5C74B5C862569DC0049C4A9?OpenDocument
I was looking to do something similar and came across this link in the R5 forum. This might give you a good starting place for some code ideas.
I also seem to remember that someone had posted a way to use JavaScript to just prevent a user from checking the checkbox for deleting a file.